Writing The Smart Contract